package cn.edu.scau.cmi.zhangjunming.client;

import java.net.URL;
import java.util.Scanner;

import cn.edu.scau.cmi.zhangjunming.abstractFactory.AbstractFactory;
import cn.edu.scau.cmi.zhangjunming.abstractFactory.AbstractFactoryController;
import cn.edu.scau.cmi.zhangjunming.abstractFactory.AonongFactory;
import cn.edu.scau.cmi.zhangjunming.abstractFactory.TianbangFactory;
import cn.edu.scau.cmi.zhangjunming.abstractFactory.WensFactory;
import cn.edu.scau.cmi.zhangjunming.simpleFactoryMethod.domain.Meat;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class AbstractFactoryClient extends Application{

	@Override
	public void start(Stage primaryStage) throws Exception {
		
		try {
			AbstractFactoryController.setStage(primaryStage);
			Parent root = FXMLLoader.load(getFxmlUrl());
			primaryStage.setTitle("抽象工厂模式");
			primaryStage.setScene(new Scene(root));
			primaryStage.show();
		}catch(Exception event) {
			event.printStackTrace();
		}
	}

	private URL getFxmlUrl() {
		AbstractFactoryController factoryController = new AbstractFactoryController();
		return factoryController.getClass().getResource("AbstractFactory.fxml");
	}
	
	public static void main(String[] args) {
		launch(args);
	}
}
